package com.group01.validation;

import com.group01.annotation.Order;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Description
 * @Author 翟玉龙
 * @Date 2024/6/22
 */
public class OrderStatusValidation implements ConstraintValidator<Order, Integer> {
    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext context) {
        if(value != null) {
            return value.equals(1) || value.equals(2) || value.equals(3) || value.equals(4) || value.equals(5); // 12345 校验
        }
        return true;
    }
}
